using System;
using System.Data.Linq.Mapping;
using CoreLibrary.Date;
using Entities.Enumeration;

namespace Entities.DataBase.Persistent {

    [Table(Name="D_PRODUCT_PURCHASE_RECORD")]
    public class PurchaseRecord {

        public PurchaseRecord() {
            CostCurrency    = Currency.AUD.Name;
            PostageCurrency = Currency.AUD.Name;
            DateCreated     = DateTime.UtcNow;
            DateUpdated     = DateUtil.Epoch;
        }

        [Column(Name = "ID", IsPrimaryKey = true)]
        public string Id { get; set; }

        [Column(Name = "PRODUCT_ID")]
        public string ProductId { get; set; }

        [Column(Name = "OPERATOR_ID")]
        public string OperatorId   { get; set; }

        [Column(Name = "POST_OPERATOR_ID")]
        public string PostOperatorId { get; set; }

        [Column(Name = "COST")]
        public decimal Cost { get; set; }

        [Column(Name = "COST_CURRENCY")]
        public string  CostCurrency { get; set; }
        
        [Column(Name = "POSTAGE")]
        public decimal Postage { get; set; }

        [Column(Name = "POSTAGE_CURRENCY")]
        public string PostageCurrency { get; set; }

        [Column(Name = "CURRENCY_RATE")]
        public decimal CurrencyRate { get; set; }

        [Column(Name = "COUNT")]
        public int Count { get; set; }

        [Column(Name = "LOCATION")]
        public int Location { get; set; }

        [Column(Name = "DATE_CREATED")]
        public DateTime DateCreated { get; set; }

        [Column(Name = "DATE_UPDATED")]
        public DateTime DateUpdated { get; set; }
    }
}